# -- Add target to global list --
list(APPEND MOD_FEM_EXEC_LIST "CREATE_MOD_FEM_NS_SUPG_ALE_REMESH_STD")
set(MOD_FEM_EXEC_LIST "${MOD_FEM_EXEC_LIST}" PARENT_SCOPE)

# -- Exec files --
set(pdd_ns_supg_ale_srcdir "${CMAKE_SOURCE_DIR}/pdd_ns_supg_ale")
#set(PDD_NS_SUPG_ALE_PRISM_STD_EXE "MOD_FEM_ns_supg_ale_prism_std")
#set(PDD_NS_SUPG_PRISM_STD_TURBULENT_EXE "MOD_FEM_ns_supg_prism_std_turbulent")
#set(PDD_NS_SUPG_HYBRID_STD_EXE "MOD_FEM_ns_supg_hybrid_std")
#set(PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXE "MOD_FEM_ns_supg_hybrid_std_turbulent")
#set(PDD_NS_SUPG_PRISM2D_STD_EXE "MOD_FEM_ns_supg_prism2d_std")
set(PDD_NS_SUPG_ALE_REMESH_STD_EXE "MOD_FEM_ns_supg_ale_remesh_std")

# -- Include directories --
list(APPEND PDD_NS_SUPG_ALE_INCLUDE_DIRS
  ${pdd_ns_supg_ale_srcdir}/adaptation
  ${pdd_ns_supg_ale_srcdir}/input_output
#  ${pdd_ns_supg_ale_srcdir}/materials
  ${pdd_ns_supg_ale_srcdir}/linear_solver_interface
  ${pdd_ns_supg_ale_srcdir}/main
  ${pdd_ns_supg_ale_srcdir}/include
  ${pdd_ns_supg_ale_srcdir}/time_integration
#  ${pdd_ns_supg_ale_srcdir}/weak_formulation
  ${pdd_ns_supg_ale_srcdir}
  ${CMAKE_SOURCE_DIR}/pdd_ns_supg/weak_formulation
  ${CMAKE_SOURCE_DIR}/pdd_ns_supg/input_output
  ${CMAKE_SOURCE_DIR}/pdd_ns_supg/materials
)
if(PDD_NS_SUPG_ALE_INCLUDE_DIRS)
  set(PDD_NS_SUPG_ALE_INCLUDE_DIRS ${PDD_NS_SUPG_ALE_INCLUDE_DIRS} PARENT_SCOPE)
endif()
# -- Source files list --
collect_src_from_include_dirs(PDD_NS_SUPG_ALE_INCLUDE_DIRS)
# -- Target --
include_directories(${PDD_NS_SUPG_ALE_INCLUDE_DIRS} ${PDD_NS_SUPG_ALE_EXTERNAL_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include)

#if(CREATE_MOD_FEM_NS_SUPG_ALE_PRISM_STD)
#  add_executable(${PDD_NS_SUPG_ALE_PRISM_STD_EXE} ${SOURCE_FILES})
#  target_link_libraries(${PDD_NS_SUPG_ALE_PRISM_STD_EXE} ${PDD_NS_SUPG_ALE_EXTERNAL_LIBRARIES} mml_prism apl_std_lin utl_system utl_util tml_omp ${MODFEM_DIRECT_SOLVER_MODULE} ${MODFEM_ITER_SOLVER_MODULE} ${MODFEM_MPI_LIBS_STD})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_ALE_PRISM_STD_EXE} PROPERTIES COMPILE_DEFINITIONS ${MODFEM_MPI_CODE_DEFINE}  DEBUG_POSTFIX "_d")
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_ALE_PRISM_STD_EXE} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_ALE_PRISM_STD_EXE} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
#endif()

#if(CREATE_MOD_FEM_NS_SUPG_HYBRID_STD)
#  add_executable(${PDD_NS_SUPG_HYBRID_STD_EXE} ${SOURCE_FILES})
#  target_link_libraries(${PDD_NS_SUPG_HYBRID_STD_EXE} ${PDD_NS_SUPG_EXTERNAL_LIBRARIES} mml_t4_prism apl_std_lin utl_system utl_util ${MODFEM_DIRECT_SOLVER_MODULE} ${MODFEM_ITER_SOLVER_MODULE} ${MODFEM_MPI_LIBS_STD} )
#  target_link_libraries(${PDD_NS_SUPG_HYBRID_STD_EXE} ${MODFEM_USER_LIBS})
#  target_link_libraries(${PDD_NS_SUPG_HYBRID_STD_EXE} ${MODFEM_USER_LIBS})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_HYBRID_STD_EXE} PROPERTIES COMPILE_DEFINITIONS ${MODFEM_MPI_CODE_DEFINE}  DEBUG_POSTFIX "_d")
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_HYBRID_STD_EXE} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")  
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_HYBRID_STD_EXE} PROPERTIES LINK_FLAGS "${LINK_FLAGS}" )
#  message("${PDD_NS_SUPG_HYBRID_STD_EXE} LINK_FLAGS ARE: ${LINK_FLAGS}")
#  message("${PDD_NS_SUPG_HYBRID_STD_EXE} COMPILE_DEFINITIONS ARE: ${MODFEM_MPI_CODE_DEFINE}")
#  message("${PDD_NS_SUPG_HYBRID_STD_EXE} COMPILE_FLAGS ARE: ${COMPILE_FLAGS}")
#endif()

if(CREATE_MOD_FEM_NS_SUPG_ALE_REMESH_STD)
  add_executable(${PDD_NS_SUPG_ALE_REMESH_STD_EXE} ${SOURCE_FILES})
  target_link_libraries(${PDD_NS_SUPG_ALE_REMESH_STD_EXE} ${PDD_NS_SUPG_ALE_EXTERNAL_LIBRARIES} mml_remesh apl_std_lin utl_system utl_util tml_omp ${MODFEM_DIRECT_SOLVER_MODULE} ${MODFEM_ITER_SOLVER_MODULE} ${MODFEM_MPI_LIBS_STD})
  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_ALE_REMESH_STD_EXE} PROPERTIES COMPILE_DEFINITIONS ${MODFEM_MPI_CODE_DEFINE}  DEBUG_POSTFIX "_d")
  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_ALE_REMESH_STD_EXE} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_ALE_REMESH_STD_EXE} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
endif()


#if(CREATE_MOD_FEM_NS_SUPG_PRISM2D_STD)
#  add_executable(${PDD_NS_SUPG_PRISM2D_STD_EXE} ${SOURCE_FILES})
#  target_link_libraries(${PDD_NS_SUPG_PRISM2D_STD_EXE} ${PDD_NS_SUPG_EXTERNAL_LIBRARIES} mml_prism_2D apl_std_lin utl_system utl_util tml_omp ${MODFEM_DIRECT_SOLVER_MODULE} ${MODFEM_ITER_SOLVER_MODULE} ${MODFEM_MPI_LIBS_STD})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_PRISM2D_STD_EXE} PROPERTIES COMPILE_DEFINITIONS ${MODFEM_MPI_CODE_DEFINE})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_PRISM2D_STD_EXE} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_PRISM2D_STD_EXE} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
#endif()

#if(CREATE_MOD_FEM_NS_SUPG_PRISM_STD_TURBULENT)
#  add_executable(${PDD_NS_SUPG_PRISM_STD_TURBULENT_EXE} ${SOURCE_FILES})
#  target_link_libraries(${PDD_NS_SUPG_PRISM_STD_TURBULENT_EXE} ${PDD_NS_SUPG_PRISM_STD_TURBULENT_EXTERNAL_LIBRARIES} mml_prism apl_std_lin utl_system utl_util tml_omp pdl_turbulent_lib pdl_cbs_lib ${MODFEM_DIRECT_SOLVER_MODULE} ${MODFEM_ITER_SOLVER_MODULE} ${MODFEM_MPI_LIBS_STD})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_PRISM_STD_TURBULENT_EXE} PROPERTIES COMPILE_DEFINITIONS ${MODFEM_MPI_CODE_DEFINE})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_PRISM_STD_TURBULENT_EXE} PROPERTIES COMPILE_DEFINITIONS TURBULENTFLOW)
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_PRISM_STD_TURBULENT_EXE} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_PRISM_STD_TURBULENT_EXE} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
#endif()

#if(CREATE_MOD_FEM_NS_SUPG_HYBRID_STD_TURBULENT)
#  add_executable(${PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXE} ${SOURCE_FILES})
#  target_link_libraries(${PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXE} ${PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXTERNAL_LIBRARIES} mml_t4_prism apl_std_lin utl_system utl_util tml_omp pdl_turbulent_lib pdl_cbs_lib ${MODFEM_DIRECT_SOLVER_MODULE} ${MODFEM_ITER_SOLVER_MODULE} ${MODFEM_MPI_LIBS_STD})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXE} PROPERTIES COMPILE_DEFINITIONS ${MODFEM_MPI_CODE_DEFINE})
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXE} PROPERTIES COMPILE_DEFINITIONS TURBULENTFLOW)
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXE} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
#  SET_TARGET_PROPERTIES(${PDD_NS_SUPG_HYBRID_STD_TURBULENT_EXE} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
#endif()

##############################################################################################################

